﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using Husb.Data;
using Husb.Util;
using GroundWater.Data;
using GroundWater.DataAccess;
using SectionPlaneTable = GroundWater.Data.InfoDataSet.SectionPlaneDataTable;
using SectionPlaneRow = GroundWater.Data.InfoDataSet.SectionPlaneRow;


namespace GroundWater.BusinessActions
{
    public class SectionPlane : DataAccessManager<InfoDataSet, SectionPlaneTable, SectionPlaneRow, SectionPlaneAdapter>
    {
        public static DataTable FetchAllWithValley()
        {
            MonitoringDataAdapter adapter = new MonitoringDataAdapter();
            SectionPlaneTable tmp = GetAll(false, true);

            SectionPlaneTable planes = new SectionPlaneTable();

            foreach (SectionPlaneRow row in tmp.Rows)
            {
                planes.ImportRow(row);
            }

            SectionPlaneRow plane = planes.NewSectionPlaneRow();
            plane.Id = Guid.NewGuid().ToByteArray();
            plane.Code = "-1";
            plane.Name = "整个流域";
            plane.QueryCode = "zgly";
            plane.Description = "整个流域";

            planes.Rows.Add(plane);


            return planes;
        }
    }
}
